package com.cgq.common;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

/**
 * Created by cgq on 2015/11/2.
 */
public class CommonFun {

    private int mScreenHeight;
    private int mScreenWidth;

    public CommonFun() {
        this.mScreenHeight = 0;
        this.mScreenWidth = 0;
    }

    public void ShowToast(Context context, CharSequence charSequence, int iTime) {
        Toast.makeText(context, charSequence, iTime).show();
    }


    public int GetScreenHeight() {
        return mScreenHeight;
    }

    public int GetScreenWidth() {
        return mScreenWidth;
    }

    public void SetScreenHeight(int mScreenHeight) {
        this.mScreenHeight = mScreenHeight;
    }

    public void SetScreenWidth(int mScreenWidth) {
        this.mScreenWidth = mScreenWidth;
    }

    public void SetWeight(View view,int iWeight) {
        ViewGroup.LayoutParams lp;
        lp=view.getLayoutParams();
        lp.width=iWeight;
        view.setLayoutParams(lp);
    }

    public void SetHeight(View view,int iHeight) {
        ViewGroup.LayoutParams lp;
        lp=view.getLayoutParams();
        lp.height=iHeight;
        view.setLayoutParams(lp);
    }


}
